package com.mazaiting.mail.converter;

import com.mazaiting.mail.domain.entity.MsgEmailSend;
import com.mazaiting.mail.dto.MailAlarmDTO;
import org.mapstruct.*;

/**
 * 邮件信息发送转换器
 *
 * @author mazaiting
 * @create_time 2022/10/6 16:58
 */
@Mapper(componentModel = MappingConstants.ComponentModel.SPRING, unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface IMsgEmailSendConverter {

    /**
     * DTO 转换为实体
     *
     * @param mailAlarmDTO dto
     * @return 实体
     */
    @Mappings({
            @Mapping(target = "toMail", source = "receiver")
    })
    MsgEmailSend dto2Entity(MailAlarmDTO mailAlarmDTO);
}
